﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace eStock.hControl
{
    public partial class hDataGridViewTextBoxColumn : DataGridViewTextBoxColumn
    {
        public hDataGridViewTextBoxColumn()
        {
            InitializeComponent();
        }

        public hDataGridViewTextBoxColumn(IContainer container)
        {
            container.Add(this);
            InitializeComponent();
        }

        protected bool hNotEmpty = false;
        [Category("1-HCOM"), Description("Kiểm tra trống")]
        public bool NotEmpty
        {
            get { return hNotEmpty; }
            set { hNotEmpty = value; }
        }

        protected string hFBCode = string.Empty;
        [Category("1-HCOM"), DefaultValue(""), Description("Mã Find Box")]
        public string FBCode
        {
            get { return hFBCode; }
            set
            {
                if (value == null)
                {
                    return;
                }
                if (value.Trim().Length == 0)
                {
                    this.DefaultCellStyle.BackColor = SystemColors.Window;
                    hFBCode = "";
                }
                else
                {
                    this.DefaultCellStyle.BackColor = Color.PaleTurquoise;
                    hFBCode = value;
                }
            }
        }

        protected bool hShowName = false;
        [Category("1-HCOM"), Description("Kiểm tra trống")]
        public bool ShowName
        {
            get { return hShowName; }
            set { hShowName = value; }
        }

        public override object Clone()
        {
            hDataGridViewTextBoxColumn clone = (hDataGridViewTextBoxColumn)base.Clone();
            clone.NotEmpty = NotEmpty;
            clone.FBCode = FBCode;
            clone.ShowName = ShowName;
            return clone;
        }
    }
}
